package com.smartfast4j.manager.modules.schedule.service;


import com.smartfast4j.pojo.schedule.ScheduleJob;
import com.smartfast4j.pojo.schedule.ScheduleJobExample;

import java.util.List;

public interface ScheduleJobService {
    int countByExample(ScheduleJobExample example);

    ScheduleJob selectByPrimaryKey(Long id);

    List<ScheduleJob> selectByExample(ScheduleJobExample example);

    int deleteByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(ScheduleJob record);

    int updateByPrimaryKey(ScheduleJob record);

    int deleteByExample(ScheduleJobExample example);

    int updateByExampleSelective(ScheduleJob record, ScheduleJobExample example);

    int updateByExample(ScheduleJob record, ScheduleJobExample example);

    int insert(ScheduleJob record);

    int insertSelective(ScheduleJob record);

    int insertBatchSelective(List<ScheduleJob> records);

    int updateBatchByPrimaryKeySelective(List<ScheduleJob> records);

    ScheduleJob queryByJobName(String jobName);

    /**
     * 保存定时任务
     */
    void save(ScheduleJob scheduleJob);

    /**
     * 更新定时任务
     */
    void update(ScheduleJob scheduleJob);

    /**
     * 删除定时任务
     */
    void delete(List<Long> jobIds);

    /**
     * 立即执行
     */
    void run(List<Long> jobIds);

    /**
     * 暂停运行
     */
    void pause(List<Long> jobIds);

    /**
     * 恢复运行
     */
    void resume(List<Long> jobIds);
}